#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/traefik-vhosts/internal-functions"

trigger-traefik-vhosts-certs-force() {
  declare desc="traefik-vhosts certs-force plugin trigger"
  declare trigger="certs-force"
  declare APP="$1"

  if [[ "$(plugn trigger proxy-type "$APP")" != "traefik" ]]; then
    return
  fi

  if [[ -n "$(fn-traefik-letsencrypt-email)" ]]; then
    echo true
  fi
}

trigger-traefik-vhosts-certs-force "$@"
